package cn.ytnet.shangyun.service.basic.entity;

import org.springframework.stereotype.Component;

import javax.persistence.*;

/**
 * Created by cyongk on 2015/12/8.
 * ClassName：WarehouseInfoEntity
 * ChineseName：仓库信息类
 */
@Component("warehouseInfoEntity")
@Entity
@Table(name = "T_WarehouseInfo", schema = "crebas", catalog = "")
public class WarehouseInfoEntity {
    private String pkTWarehouseinfoId;
    private String warehouseName;
    private String warehousePhoneticcode;

    @Id
    @Column(name = "pk_t_warehouseinfo_id", nullable = false, length = 3)
    public String getPkTWarehouseinfoId() {
        return pkTWarehouseinfoId;
    }

    public void setPkTWarehouseinfoId(String pkTWarehouseinfoId) {
        this.pkTWarehouseinfoId = pkTWarehouseinfoId;
    }

    @Basic
    @Column(name = "warehouse_name", nullable = false, length = 30)
    public String getWarehouseName() {
        return warehouseName;
    }

    public void setWarehouseName(String warehouseName) {
        this.warehouseName = warehouseName;
    }

    @Basic
    @Column(name = "warehouse_phoneticcode", nullable = false, length = 100)
    public String getWarehousePhoneticcode() {
        return warehousePhoneticcode;
    }

    public void setWarehousePhoneticcode(String warehousePhoneticcode) {
        this.warehousePhoneticcode = warehousePhoneticcode;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        WarehouseInfoEntity that = (WarehouseInfoEntity) o;

        if (pkTWarehouseinfoId != null ? !pkTWarehouseinfoId.equals(that.pkTWarehouseinfoId) : that.pkTWarehouseinfoId != null)
            return false;
        if (warehouseName != null ? !warehouseName.equals(that.warehouseName) : that.warehouseName != null)
            return false;
        return warehousePhoneticcode != null ? warehousePhoneticcode.equals(that.warehousePhoneticcode) : that.warehousePhoneticcode == null;

    }

    @Override
    public int hashCode() {
        int result = pkTWarehouseinfoId != null ? pkTWarehouseinfoId.hashCode() : 0;
        result = 31 * result + (warehouseName != null ? warehouseName.hashCode() : 0);
        result = 31 * result + (warehousePhoneticcode != null ? warehousePhoneticcode.hashCode() : 0);
        return result;
    }
}
